package com.sikaryofficial.backend.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.sikaryofficial.system.api.model.infomation.ArticleCategoryObjVO;
import com.sikaryofficial.system.api.model.infomation.FriendObjVO;
import com.sikaryofficial.system.api.model.infomation.TopicObjVO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 文章扩展对象 article_ext_t
 *
 * @author qinjinyuan
 * @date 2024-04-15
 */
@Getter
@Setter
@ToString
@TableName(value = "article_ext_t", autoResultMap = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ArticleExt implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 文章ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long articleId;

    /**
     * 子标题对象
     */
    @TableField(typeHandler = FastjsonTypeHandler.class, value = "`article_category_list`")
    private List<ArticleCategoryObjVO> articleCategoryList;

    /**
     * topic对象
     */
    @TableField(typeHandler = FastjsonTypeHandler.class, value = "`topic_list`")
    private List<TopicObjVO> topicList;

    /**
     * 好友对象列表
     */
    @TableField(typeHandler = FastjsonTypeHandler.class, value = "`friend_list`")
    private List<FriendObjVO> friendList;

    /**
     * 租户号
     */
    private Integer tenantId;

    /**
     * 乐观锁
     */
    private Integer revision;

    /**
     * 创建人
     */
    private Long createdBy;

    /**
     * 创建时间
     */
    private Date createdTime;

    /**
     * 创建人名称
     */
    private String createdName;

    /**
     * 更新人
     */
    private Long updatedBy;

    /**
     * 更新时间
     */
    private Date updatedTime;

    /**
     * 删除版本：默认为0；删除则赋值当前记录主键ID
     */
    private Long deletedVersion;
}
